properly maintain. Also removed the corresponding methods from ApiBase and
the 'APIGetPossibleErrors' and 'APIGetResultProperties' hooks.
* Formats dbg, dump, txt, wddx, and yaml are now deprecated.
+* action=paraminfo now indicates when a parameter is specifying a submodule.
+ Internally, a new param type 'submodule' is available to indicate this which
+ automatically queries the list of submodule names from the ApiModuleManager.
=== Languages updated in 1.24 ===
$prompt = 'One value: ';
}
+ if ( $type === 'submodule' ) {
+ $type = $this->getModuleManager()->getNames( $paramName );
+ sort( $type );
+ }
if ( is_array( $type ) ) {
$choices = array();
$nothingPrompt = '';
if ( isset( $value ) && $type == 'namespace' ) {
$type = MWNamespace::getValidNamespaces();
}
+ if ( isset( $value ) && $type == 'submodule' ) {
+ $type = $this->getModuleManager()->getNames( $paramName );
+ }
}
if ( isset( $value ) && ( $multi || is_array( $type ) ) ) {
return array(
'format' => array(
ApiBase::PARAM_DFLT => ApiMain::API_DEFAULT_FORMAT,
- ApiBase::PARAM_TYPE => $this->mModuleMgr->getNames( 'format' )
+ ApiBase::PARAM_TYPE => 'submodule',
),
'action' => array(
ApiBase::PARAM_DFLT => 'help',
- ApiBase::PARAM_TYPE => $this->mModuleMgr->getNames( 'action' )
+ ApiBase::PARAM_TYPE => 'submodule',
),
'maxlag' => array(
ApiBase::PARAM_TYPE => 'integer'
}
if ( isset( $p[ApiBase::PARAM_TYPE] ) ) {
- $a['type'] = $p[ApiBase::PARAM_TYPE];
+ if ( $p[ApiBase::PARAM_TYPE] === 'submodule' ) {
+ $a['type'] = $obj->getModuleManager()->getNames( $n );
+ sort( $a['type'] );
+ $a['submodules'] = '';
+ } else {
+ $a['type'] = $p[ApiBase::PARAM_TYPE];
+ }
if ( is_array( $a['type'] ) ) {
// To prevent sparse arrays from being serialized to JSON as objects
$a['type'] = array_values( $a['type'] );
$result = array(
'prop' => array(
ApiBase::PARAM_ISMULTI => true,
- ApiBase::PARAM_TYPE => $this->mModuleMgr->getNames( 'prop' )
+ ApiBase::PARAM_TYPE => 'submodule',
),
'list' => array(
ApiBase::PARAM_ISMULTI => true,
- ApiBase::PARAM_TYPE => $this->mModuleMgr->getNames( 'list' )
+ ApiBase::PARAM_TYPE => 'submodule',
),
'meta' => array(
ApiBase::PARAM_ISMULTI => true,
- ApiBase::PARAM_TYPE => $this->mModuleMgr->getNames( 'meta' )
+ ApiBase::PARAM_TYPE => 'submodule',
),
'indexpageids' => false,
'export' => false,